// 金额转换，三位分隔
export function formatMoney(str: string | number): string {
  if (typeof str === 'number') {
    str = '' + str.toFixed(2)
  }
  return str.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,')
}
